{% extends 'admin/common/base.html' %}
{% block css %}
{{super()}}
<link href="{{url_for('admin.static',filename='ajax/libs/jasny/jasny-bootstrap.min.css')}}?v=3.1.3" rel="stylesheet"/>
{% endblock %}
{% block body %}
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form">
            <input type="hidden" name="id" value="{{d.id}}">
            <div class="form-group">
				<label class="col-sm-3 control-label ">备注：</label>
				<div class="col-sm-8">
                    <textarea id="remark" name="remark" class="form-control">{{d.remark}}</textarea>
				</div>
			</div>
            <div class="form-group">
				<label class="col-sm-3 control-label is-required">连接：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="link" id="link" value="{{d.link}}" required>
				</div>
			</div>
            <div class="form-group">
				<label class="col-sm-3 control-label is-required">名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" id="name" value="{{d.name}}" required>
				</div>
			</div>
            <div class="form-group">
				<label class="col-sm-3 control-label is-required">状态：</label>
				<div class="col-sm-8">
                    <select id="state" name="state" class="form-control m-b">
						{% for dd in get_dict_data('cms_friendlylink_state')%}
						<option value="{{dd.value}}" {{'selected' if d.state == dd.value else '' }}>{{dd.label}}</option>
						{% endfor %}
					</select>
				</div>
			</div>
		</form>
	</div>
</body>
{% endblock %}
{% block js %}
{{ super() }}
<script src="{{url_for('admin.static',filename='ajax/libs/jasny/jasny-bootstrap.min.js')}}?v=3.1.3"></script>
<script type="text/javascript">

    
    $("#form").validate({

    });
    
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save("{{url_for('admin.cms.friendlylink.edit')}}", $('#form').serialize());
        }
    }

</script>
{% endblock %}
